package com.paraz.cst;

/**
 * Result of a process.
 * Immutable.
 * 
 * @author mparaz
 *
 */
public class CstProcessorResult {
	/**
	 * Constant for no result.
	 */
	public static final CstProcessorResult NONE = new CstProcessorResult(null);

	private final String result;
	
	/**
	 * Static factory for non-null checking, and potential instance reuse.
	 * @param result
	 * @return
	 */
	public static CstProcessorResult create(String result) {
		if (result == null) {
			throw new IllegalArgumentException("result may not be null");
		}
		return new CstProcessorResult(result);
	}
	
	
	/**
	 * Private constructor to control instance creation.

	 * @param result
	 */
	private CstProcessorResult(String result) {
		super();
		this.result = result;
	}
	
	public String getResult() {
		return result;
	}

	public String toString() {
		return getResult();
	}
	
}
